<?php

/**
 * 获取全部的自定义url以及系统模块的url管理logic
 */

namespace Member\Logic;

class MoudleUrlLogic extends CommonLogic {

	/**
	 * 获取全部的系统模块Url
	 */
	public function allLists(){
		
		$data = $this->field(true)->select();
		
		return $data;
	}
	
	/**
	 * 根据选择的信息返回需要保存到数据库中的信息
	 */
	public function savedata($name){
		$newsmsgLogic = D('Newsmsg','Logic');
		//如果是单图文消息内容
		if(intval($name) > 0){
			$newmsg = $newsmsgLogic->detail(intval($name));
			 
		}else{
			//如果是模块内容信息
			$newmsg = $newsmsgLogic->where(array('relation'=>$name,'uid'=>UID))->find();
		}
		$data = array(
		    'msgtype'=>$newmsg['msgtype'],
		    'msgid'=>$newmsg['id'],
		);
		
		return $data;
			
	}
	/* (non-PHPdoc)
	 * @see \Member\Logic\CommonLogic::autoSave()
	 */
	public function autoSave($id = 0) {
		// TODO Auto-generated method stub
		
	}

	/* (non-PHPdoc)
	 * @see \Member\Logic\CommonLogic::update()
	 */
	public function update($id = 0) {
		// TODO Auto-generated method stub
		
	}

	
	
}